package com.wsl.controller;

import com.wsl.bean.Person;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author:WangShuliang
 * @Description:
 * @Date:Created in 11:43 2017/11/1
 * @Modified by:
 */
@Controller
public class PersonController {
    @RequestMapping("/ss")
    public String index(Model model){
        Person single = new Person();
        List<Person> people = new ArrayList<Person>();
        Person p1= new Person("XX",11);
        Person p2=new Person("yy",22);
        Person p3 = new Person("zz",33);
        people.add(p1);
        people.add(p2);
        people.add(p3);
        model.addAttribute("singlePerson",single);
        model.addAttribute("people",people);
        return "index";
    }
}